﻿CREATE proc [dbo].[danhmucKH_Them]
@masokh varchar(255),
@tenkh nvarchar(255),
@diachi nvarchar(255),
@sodienthoai nvarchar(255),
@mathuecu nvarchar(255)
as
if exists(select * from DM_KhachHang   Where masokh =@masokh  or tenkh  =@tenkh    )
begin
select ErrCode=0
end
else
begin
insert into DM_KhachHang (masokh,tenkh,diachi,sodienthoa,mathuecu)
				values(@masokh,@tenkh,@diachi,@sodienthoai,@mathuecu) 
select ErrCode=1
end